package com.eig.system.controller;


import com.eig.common.entity.AclPermission;
import com.eig.common.vo.Result;
import com.eig.system.service.AclPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: eight-education-cloud
 * @description:
 * @author:
 * @create:
 **/
@RestController
@RequestMapping("/system/permission")
public class AclPermissionController {

    @Autowired
    private AclPermissionService permissionService;

    @GetMapping("/getByUserid/{userid}")
    public Result<AclPermission> getByUserid(@PathVariable Long userid){
        return permissionService.findByUserId(userid);
    }

    @GetMapping("getAllPermission")
    public Result<List<AclPermission>> getAllPermission(){
        return permissionService.findByUsername();
    }

}
